const query = require('../db/query')

// 获取用户列表
const getUserList = (params) =>{
    let sql = `select * from user`
    return query(sql)
}

// 新增用户列表
const userListAdd = (params)=>{
    let sql = `insert into user (username,userstanding,userbirthday,usersex,userphone,userrelation,userage) values ('${params.name}','${params.standing}','${params.birthday}','${params.sex}','${params.phone}','${params.relation}','${params.age}')`
    return query(sql)
}

// 删除用户列表
const userDelete = (params) =>{
    let sql = `DELETE FROM user where id = ${params.id}`
    return query(sql)
}

module.exports = {
    getUserList,
    userListAdd,
    userDelete
}